|
|
@@ -7,7 +7,7 @@ module TwitterConcern
|
7
|
7
|
validate :validate_twitter_options
|
8
|
8
|
valid_oauth_providers :twitter
|
9
|
9
|
|
10
|
|
- gem_dependency_check { defined?(Twitter) && Devise.omniauth_providers.include?(:twitter) }
|
|
10
|
+ gem_dependency_check { defined?(Twitter) && Devise.omniauth_providers.include?(:twitter) && ENV['TWITTER_OAUTH_KEY'].present? && ENV['TWITTER_OAUTH_SECRET'].present? }
|
11
|
11
|
end
|
12
|
12
|
|
13
|
13
|
def validate_twitter_options
|
|
|
@@ -46,9 +46,9 @@ module TwitterConcern
|
46
|
46
|
|
47
|
47
|
module ClassMethods
|
48
|
48
|
def twitter_dependencies_missing
|
49
|
|
- if defined?(Twitter)
|
|
49
|
+ if ENV['TWITTER_OAUTH_KEY'].blank? || ENV['TWITTER_OAUTH_SECRET'].blank?
|
50
|
50
|
"## Set TWITTER_OAUTH_KEY and TWITTER_OAUTH_SECRET in your environment to use Twitter Agents."
|
51
|
|
- else
|
|
51
|
+ elsif !defined?(Twitter) || !Devise.omniauth_providers.include?(:twitter)
|
52
|
52
|
"## Include the `twitter`, `omniauth-twitter`, and `cantino-twitter-stream` gems in your Gemfile to use Twitter Agents."
|
53
|
53
|
end
|
54
|
54
|
end
|